<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" >
<head>
    <meta charset="UTF-8">
    <title>章节</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
</head>
<body>
<nav th:replace="teacher/_fragments :: menu(1)" class="ui inverted  segment">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">CUMT</h2>
            <h3 class="ui teal header item">在线答题系统</h3>
            <a href="#" class=" active item ">章节</a>
            <a href="#" class=" item ">知识点</a>
            <a href="#" class=" item ">题目</a>
            <a href="#" class=" item ">试卷</a>
            <a href="#" class=" item ">成绩</a>

            <div class="right menu   ">
                <div class="ui dropdown item">
                    <div class="text">
                        Zhaohaihang
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</nav>

<div class="ui container">
    <form action="#" method="POST"  th:object="${chapter}"  th:action="*{id}==null ? @{/teacher/tea-chapter-input} : @{/teacher/tea-chapter-input/{id}(id=*{id})}" class="ui form">

        <input type="hidden" name="id" th:value="*{id}">
        <div class=" required field">
            <div class="ui left labeled input">
                <label class="ui teal basic label"> 章节序号</label>
                <input type="text" name="chapterNum" placeholder="第X章" th:value="*{chapterNum}">
            </div>
        </div>
        <div class=" required field">
            <div class="ui left labeled input">
                <label class="ui teal basic label"> 章节名称</label>
                <input type="text" name="chapterName" placeholder="XXXXXX" th:value="*{chapterName}" >
            </div>
        </div>

        <!--/*/
                        <div class=" ui negative message" th:if="${#fields.hasErrors('chapterName')}">
                            <i class=" close icon"></i>
                            <div class="header ">验证失败</div>
                            <p th:errors="*{chapterName}"> 提交信息不符合规则</p>
                        </div>
                        /*/-->
        <div class="ui error message"></div>
        <div class="ui right aligned container">
            <button class="ui button " type="button" onclick="window.history.go(-1)">返回</button>
            <button class="ui teal submit button ">提交</button>
        </div>
    </form>
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>

<script>
    $('.ui.dropdown').dropdown({
        on: 'hover'
    });
</script>
</body>
</html>